<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<include file="Public/header" />
<load href="__PUBLIC__/Js/Calendar.js" />
<script type="text/javascript">
$(function(){
     $('#check').click(function(){
        var inputs = $(this).parents('.list_vmall_man').find('input');
        $(this).prop('checked') ? inputs.prop('checked',true):
           inputs.removeAttr('checked');
     });
    $(".allCommand").click(function(){
        var checkedNum = $("input[name='ids[]']:checked").length;
        if(checkedNum == 0) {
            alert("请至少选择一项！");
            return false;
        }
		var url =$(this).attr('url');
        var checkedList = new Array();
        $("input[name='ids[]']:checked").each(function() {
            checkedList.push($(this).val());
        });
        window.location.href = url+'?ids='+checkedList;
    });
})
</script>
</head>


<body>  
 
        <div class="list_vmall_man">
		 <div class="list_vmall_le">
        	<include file="./Apps/BoxAdmin/View/Public/adminMenu.html" />
			</div>
            <div class="list_vmall_rig">
            	<div class="list_vmall_bort">
                	<table width="100%" border="1" cellspacing="1" cellpadding="1">
                      <tr>
					  <td>
					  <form method="get" action="<{:U('index')}>">
  <div class="table_div">关键字：<input type="text" placeholder="卡号" value="<{$kw}>" name="kw" />
					  &nbsp;&nbsp; <!--电商平台： <select name="store_id">
					  <option value="0">全部</option>
							    <volist name="storeList" id="vo">
								  <option <if condition="$vo['store_id'] eq $store_id"> selected="selected"</if> value="<{$vo.store_id}>"><{$vo.store_name}></option>
								</volist>
							   </select>-->
							   过期时间从：<input type="text" size="9" class="input-small datetimepicker" data-date="" data-date-format="yyyy-mm-dd"  readonly="readonly" name="mintime" value="<{$_GET['mintime']}>" /> -- <input type="text" size="9"  id="control_date"  class="input-small datetimepicker" data-date="" data-date-format="yyyy-mm-dd"  readonly="readonly" name="maxtime" value="<{$_GET['maxtime']}>" />
							   
							   &nbsp;&nbsp;生成时间从：<input type="text" size="9"  class="input-small datetimepicker" data-date="" data-date-format="yyyy-mm-dd"  readonly="readonly" name="s_addtime" value="<{$_GET['s_addtime']}>" /> -- <input type="text" size="9" class="input-small datetimepicker" data-date="" data-date-format="yyyy-mm-dd"  readonly="readonly" name="e_addtime" value="<{$_GET['e_addtime']}>" />
							   </div>
                <div class="table_div">            金额从:  <input type="text" size="5"   name="minmoney"  value="<{$_GET['minmoney']}>" /> -- <input type="text" size="5"  name="maxmoney" value="<{$_GET['maxmoney']}>" />
							   &nbsp;&nbsp;卡状态：
								<select name="state">
								<option value="0">全部</option>
								 <volist name="stateArray" id="vo">
								  <option <if condition="$key eq $state"> selected="selected"</if> value="<{$key}>"><{$vo}></option>
								</volist>
								 
								</select>
								<input type="hidden" name="export" id="export" value="0"  />
								<input type="submit" class="btn" style="height:28px;" onclick="$('#export').val('0')" value="查询"  />
								<input type="submit" class="btn" style="height:28px;" onclick="$('#export').val('1')" value="查询结果导出到Excel"  /></div>
					  </form>			
								
								</td>
                      	<td height="46">
						<!--<a href="#" onclick="$('#export').val('1');"  class="v_mall_q">导出结果卡券</a>-->
						<!--<a href="<{:U('import')}>" class="v_mall_q"><i class="v_mall_fi"></i>导入卡券</a></td>-->
                      </tr>
                    </table>
					<table width="100%" class="v_am_bor_t v_am_td" border="1" cellspacing="1" cellpadding="1">
                       <tr class="v_am_bg_top" height="30">
                        <td width="50" align="center"><input type="checkbox" id="check" /></td>
                        <td height="34" align="center" valign="middle" class="v_am_font">卡号</td>
						<!--<td height="34" align="center" valign="middle" class="v_am_font">电商平台</td>-->
                        <td height="34" align="center" valign="middle" class="v_am_font" align="center">卡金额</td>
                        <td height="34" align="center" valign="middle" class="v_am_font">生成时间</td>
						 <td height="34" align="center" valign="middle" class="v_am_font">过期时间</td>
						 <td height="34" align="center" valign="middle" class="v_am_font">生成人</td>
						<!-- <td height="34" align="center" valign="middle" class="v_am_font">销售公司</td>
						 <td height="34" align="center" valign="middle" class="v_am_font">销售人员</td>-->
						 <td height="34" align="center" valign="middle" class="v_am_font">状态</td>
						 
                        <td height="34" align="center" valign="middle" class="v_am_font" style="border-right:0;">操作</td>
                      </tr>
					  <volist name="data" id="vo">
                      <tr>
                         <td align="center" valign="middle"><input type="checkbox" name="ids[]" value="<{$vo.id}>" /></td>
                        <td height="36" align="center" valign="middle"><{$vo.num}></td>
                       <!-- <td height="36" align="center" valign="middle"> 
						 <{$storeList[$vo['store_id']]['store_name']?$storeList[$vo['store_id']]['store_name']:"无"}>
						 </td>-->
                        <td height="36" align="center" valign="middle"><{$vo['money']}></td>
				
            <!-- <td height="36" align="left" valign="middle"><span style="padding-left:10px;"><{$vo.cate_name}></span></td> -->
            <td height="36" align="left" valign="middle"><span style="padding-left:10px;"><{$vo.addtime}></span></td> 
						
						<td height="36" align="left" valign="middle"><span style="padding-left:10px;"><{$vo.invalid_time}></span></td>
						<td height="36" align="left" valign="middle"><span style="padding-left:10px;"><{$vo['store_user_name']}></span></td>
					<!--	<td height="36" align="left" valign="middle"><span style="padding-left:10px;"><{$vo['company']}></span></td>
						<td height="36" align="left" valign="middle"><span style="padding-left:10px;"><{$vo['seller']?$vo['seller']:"没填"}></span></td>	<td height="34" align="center" valign="middle" class="v_am_font"><{$stateArray[$vo['state']]}></td>-->
							 
                        <td style="border-right:0;"  height="36" align="center" valign="middle">
                      <if condition="$vo['state'] eq 1 or $vo['state'] eq 3">
					    <a   href="<{:U('stateact',array('ids'=>$vo['id'],'state'=>2))}>" class="btn">激活</a>
					 </if>	
					  <if condition="$vo['state'] lt 3">
                            <a  onclick="return confirm('确认冻结吗？');"  href="<{:U('stateact',array('ids'=>$vo['id'],'state'=>3))}>" class="btn">冻结</a> 
					</if>
							 <if condition="$vo['state'] lt 4">
							<a  onclick="return confirm('确认作废吗？');"  href="<{:U('stateact',array('ids'=>$vo['id'],'state'=>4))}>" class="btn">作废</a> 
							</if>	
					 
						 
						 
                             
                        </td>
                      </tr>
                    </volist>
                    </table>
<br />
                   
                    <a class="btn allCommand" style="padding:2px 10px;" url="<{:U('stateact',array('state'=>2))}>">激活</a>
					  <a class="btn allCommand" style="padding:2px 10px;" url="<{:U('stateact',array('state'=>3))}>">冻结</a>
					    <a class="btn allCommand" style="padding:2px 10px;" url="<{:U('stateact',array('state'=>4))}>">作废</a>
						
                   <include file="./Apps/BoxAdmin/View/Ace/Public/pager.html" />
                </div>
            </div>
        </div>
 
</body>
</html>
